﻿/**
 * ...
 * @author	Kliment
 * @version	1.1.0
 */
class kliment.geom.draw.GradientStyle {
	public static var TYPE_LINEAR:String = 'linear';
	public static var TYPE_RADIAL:String = 'radial';
	
	public static var SPREADMETHOD_PAD:String = 'pad';
	public static var SPREADMETHOD_REFLECT:String = 'reflect';
	public static var SPREADMETHOD_REPEAT:String = 'repeat';
	
	public static var INTERPOLATIONMETHOD_RGB:String = 'RGB';
	public static var INTERPOLATIONMETHOD_LINEARRGB:String = 'linearRGB';
	
	public var fillType:String;
	public var colors:Array;
	public var alphas:Array;
	public var ratios:Array;
	public var matrix:Object;
	public var spreadMethod:String;
	public var interpolationMethod:String;
	public var focalPointRatio:Number;
	
	public function GradientStyle(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object, spreadMethod:String, interpolationMethod:String, focalPointRatio:Number) {
		this.fillType = (fillType != null)?fillType:TYPE_LINEAR;
		this.colors = (colors != null)?colors:[0x000000, 0xffffff];
		this.alphas = (alphas != null)?alphas:[100, 100];
		this.ratios = (ratios != null)?ratios:0;
		this.matrix = (matrix != null)?matrix:new Object();
		this.spreadMethod = spreadMethod;
		this.interpolationMethod = interpolationMethod;
		this.focalPointRatio = focalPointRatio;
	}
	
	public function clone():GradientStyle {
		return new GradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);
	}
}